package com.deuwise.system.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.annotations.TableField;
import com.deuwise.common.validator.group.AddGroup;
import com.deuwise.common.validator.group.UpdateGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 *@author deuwise
 *@date 2018-11-12 16:05:19
 */
@Data
@EqualsAndHashCode(callSuper=true)
@TableName("sys_dict")
public class DictDo extends Model<DictDo> implements Serializable{
    /**主键id*/
    @ApiModelProperty("主键id")
    @TableField("id")
    private String id;

    /**标签名*/
    @ApiModelProperty("标签名")
    @TableField("name")
    @Length(max =100,message ="标签名长度不能超过{max}",groups ={AddGroup.class, UpdateGroup.class})
    private String name;

    /**数据值*/
    @ApiModelProperty("数据值")
    @TableField("value")
    @Length(max =100,message ="数据值长度不能超过{max}",groups ={AddGroup.class, UpdateGroup.class})
    private String value;

    /**类型*/
    @ApiModelProperty("类型")
    @TableField("type")
    private String type;

    /**描述*/
    @ApiModelProperty("描述")
    @TableField("description")
    @Length(max =100,message ="描述长度不能超过{max}",groups ={AddGroup.class, UpdateGroup.class})
    private String description;

    /**排序（升序）*/
    @ApiModelProperty("排序（升序）")
    @TableField("order_num")
    private Integer orderNum;

    /**父级编号*/
    @ApiModelProperty("父级编号")
    @TableField("parent_id")
    private String parentId;

    @ApiModelProperty("父节点名称")
    @TableField(exist = false)
    private  String parentName;

    /**创建者*/
    @ApiModelProperty("创建者")
    @TableField("create_by")
    private String createBy;

    /**创建时间*/
    @ApiModelProperty("创建时间")
    @TableField("create_date")
    private Date createDate;

    /**更新者*/
    @ApiModelProperty("更新者")
    @TableField("update_by")
    private String updateBy;

    /**更新日期*/
    @ApiModelProperty("更新日期")
    @TableField("update_date")
    private Date updateDate;

    /**备注信息*/
    @ApiModelProperty("备注信息")
    @TableField("remarks")
    @Length(max =200,message ="备注长度不能超过{max}",groups ={AddGroup.class, UpdateGroup.class})
    private String remarks;

    /**删除标记*/
    @ApiModelProperty("删除标记")
    @TableField("deleted")
    private Integer deleted;

    @Override
    protected Serializable pkVal() {
        return id;
    }
}